// app/models/user.js
// load the things we need
var mongoose = require('mongoose');

// define the schema for our user model
var Userinfo = new mongoose.Schema({

    nickname: String,
    gender: Number,
    city: String,
    followerCount: Number,
    uid: String,
    addTime: Date,
    account: String,
    deleted: Number,
    updatetime: Date,
    postCount: Number,
    fansCount: Number,
    searched: Number,
    accountName: String,
    source: Number,
    exclude: Number,
    own : Number,
    interactiontime :Date,
    category:String
});

// methods ======================
Userinfo.index({ addTime: -1 ,exclude:-1,source:-1,own:-1,searched:1,account:1,uid:1});
// create the model for users and expose it to our app
module.exports = mongoose.model('Userinfo', Userinfo);